package 多态;

public class demo2 {
    public static void main(String[] args) {
        Animal a = new Cat();
        System.out.println(a.name);//编译看左边，运行看左边
        a.A();//编译看左边，运行看右边
    }
}

class Cat extends Animal {
    String name = "C";
    int age = 10;

    public void A() {
        System.out.println("Cat");
    }

    public void eat() {
        System.out.println("Cat eat");
    }
}

class Animal {
    String name = "A";

    public void A() {
        System.out.println("Animal");
    }
}

abstract  interface I{
    void test();
}
